impl. (gtk_tool_item_class_init): hook it up.
authorMichael Meeks <michael@ximian.com>
Fri, 20 Feb 2004 18:02:21 +0000 (18:02 +0000)
committerMichael Meeks <michael@src.gnome.org>
Fri, 20 Feb 2004 18:02:21 +0000 (18:02 +0000)
2004-02-20  Michael Meeks  <michael@ximian.com>

* gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl.
(gtk_tool_item_class_init): hook it up.
(gtk_tool_item_set_proxy_menu_item): synchronize sensitivity.

* gtk/gtktoolbutton.c (gtk_tool_button_property_notify):
chain to parent, fix strcmp bug.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktoolbutton.c
gtk/gtktoolitem.c

index a24ef33e49accbd6b905d9af72e4185c3b3c5141..8d0ba2a97d3dd34524491559dfd8563a2d358158 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-02-20  Michael Meeks  <michael@ximian.com>
 
+       * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl.
+       (gtk_tool_item_class_init): hook it up.
+       (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity.
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_property_notify):
+       chain to parent, fix strcmp bug.
+
        * tests/testtoolbar.c (main): re-arrange widgets to allow
        more overflowing toolbar goodness.
 
index a24ef33e49accbd6b905d9af72e4185c3b3c5141..8d0ba2a97d3dd34524491559dfd8563a2d358158 100644 (file)
@@ -1,5 +1,12 @@
 2004-02-20  Michael Meeks  <michael@ximian.com>
 
+       * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl.
+       (gtk_tool_item_class_init): hook it up.
+       (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity.
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_property_notify):
+       chain to parent, fix strcmp bug.
+
        * tests/testtoolbar.c (main): re-arrange widgets to allow
        more overflowing toolbar goodness.
 
index a24ef33e49accbd6b905d9af72e4185c3b3c5141..8d0ba2a97d3dd34524491559dfd8563a2d358158 100644 (file)
@@ -1,5 +1,12 @@
 2004-02-20  Michael Meeks  <michael@ximian.com>
 
+       * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl.
+       (gtk_tool_item_class_init): hook it up.
+       (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity.
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_property_notify):
+       chain to parent, fix strcmp bug.
+
        * tests/testtoolbar.c (main): re-arrange widgets to allow
        more overflowing toolbar goodness.
 
index a24ef33e49accbd6b905d9af72e4185c3b3c5141..8d0ba2a97d3dd34524491559dfd8563a2d358158 100644 (file)
@@ -1,5 +1,12 @@
 2004-02-20  Michael Meeks  <michael@ximian.com>
 
+       * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl.
+       (gtk_tool_item_class_init): hook it up.
+       (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity.
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_property_notify):
+       chain to parent, fix strcmp bug.
+
        * tests/testtoolbar.c (main): re-arrange widgets to allow
        more overflowing toolbar goodness.
 
index a24ef33e49accbd6b905d9af72e4185c3b3c5141..8d0ba2a97d3dd34524491559dfd8563a2d358158 100644 (file)
@@ -1,5 +1,12 @@
 2004-02-20  Michael Meeks  <michael@ximian.com>
 
+       * gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl.
+       (gtk_tool_item_class_init): hook it up.
+       (gtk_tool_item_set_proxy_menu_item): synchronize sensitivity.
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_property_notify):
+       chain to parent, fix strcmp bug.
+
        * tests/testtoolbar.c (main): re-arrange widgets to allow
        more overflowing toolbar goodness.
 
index 516f93c3b7a6cd6ac7d80167f6f6f643ddeada29..0796c89f1b508898a9e465cdb954827a35e5f581 100644 (file)
@@ -442,8 +442,11 @@ static void
 gtk_tool_button_property_notify (GObject          *object,
                                 GParamSpec       *pspec)
 {
-  if (strcmp (pspec->name, "is_important"))
+  if (strcmp (pspec->name, "is-important") == 0)
     gtk_tool_button_construct_contents (GTK_TOOL_ITEM (object));
+
+  if (parent_class->notify)
+    parent_class->notify (object, pspec);
 }
 
 static void
index 8969adf7eb4a1e4cd0ad7437a60ee79640b5fe42..42c79cccf4c0256fe99f12f8e42c27e5772b9e68 100644 (file)
@@ -76,6 +76,8 @@ static void gtk_tool_item_get_property (GObject         *object,
                                        guint            prop_id,
                                        GValue          *value,
                                        GParamSpec      *pspec);
+static void gtk_tool_item_property_notify (GObject      *object,
+                                          GParamSpec   *pspec);
 static void gtk_tool_item_realize       (GtkWidget      *widget);
 static void gtk_tool_item_unrealize     (GtkWidget      *widget);
 static void gtk_tool_item_map           (GtkWidget      *widget);
@@ -136,6 +138,7 @@ gtk_tool_item_class_init (GtkToolItemClass *klass)
   object_class->set_property = gtk_tool_item_set_property;
   object_class->get_property = gtk_tool_item_get_property;
   object_class->finalize = gtk_tool_item_finalize;
+  object_class->notify = gtk_tool_item_property_notify;
 
   widget_class->realize       = gtk_tool_item_realize;
   widget_class->unrealize     = gtk_tool_item_unrealize;
@@ -337,6 +340,17 @@ gtk_tool_item_get_property (GObject    *object,
     }
 }
 
+static void
+gtk_tool_item_property_notify (GObject    *object,
+                              GParamSpec *pspec)
+{
+  GtkToolItem *tool_item = GTK_TOOL_ITEM (object);
+
+  if (tool_item->priv->menu_item && strcmp (pspec->name, "sensitive") == 0)
+    gtk_widget_set_sensitive (tool_item->priv->menu_item,
+                             GTK_WIDGET_SENSITIVE (tool_item));
+}
+
 static void
 create_drag_window (GtkToolItem *toolitem)
 {
@@ -1059,6 +1073,9 @@ gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item,
        {
          g_object_ref (menu_item);
          gtk_object_sink (GTK_OBJECT (menu_item));
+
+         gtk_widget_set_sensitive (menu_item,
+                                   GTK_WIDGET_SENSITIVE (tool_item));
        }
       
       tool_item->priv->menu_item = menu_item;